﻿<%@ WebHandler Language="C#" Class="ShowListLoan" %>

using System;
using System.Web;
using System.Text;
using System.Data;
using Chenxin.Lib.Utility;
using Chenxin.Lib.Business;
using Chenxin.Lib.Business.BLL;

public class ShowListLoan : AjaxHandlerBase
{
    /// <summary>
    /// 基本权限项
    /// </summary>
    public ShowListLoan()
    {
        //贷款奖励
        htTypePermit.Add("loanencouragement", Constants.Permit_loanencouragement);
        //导出
        htTypePermit.Add("export", Constants.Permit_Loan_Export);
        //撤销预审
        htTypePermit.Add("deleteloaninfo", Constants.Permit_DeleteLoanInfo);
        //恢复撤销
        htTypePermit.Add("resumeloaninfo", Constants.Permit_ResumeLoanInfo);
    }

    override public void RequestProcess(HttpContext context)
    {
        string strOp = context.Request["op"];
        string strResponse = "";
        switch (strOp.ToLower())
        {
            //获取实体
            case "getmodel":
                strResponse = GetModel(context);
                break;
            //查询
            case "search":
                strResponse=Search(context);
                break;
            //贷款奖励
            case "loanencouragement":
                strResponse = LoanEncouragement(context);
                break;
            //撤销预审
            case "deleteloaninfo":
                strResponse = DelPre(context);
                break;
            //恢复撤销
            case "resumeloaninfo":
                strResponse = ResPre(context);
                break;
            default:
                break;
        }
        context.Response.Write(strResponse);
    }

    /// <summary>
    /// 获取实体
    /// </summary>
    /// <param name="context"></param>
    /// <returns></returns>
    private string GetModel(HttpContext context)
    {
        try
        {
            Chenxin.Lib.Business.Entity.t_Preliminary_SubInfo3 model = null;

            model = Chenxin.Lib.Business.DAL.t_Preliminary_SubInfo3.GetLoanModel(new Guid(context.Request["modelid"]));

            if (model != null)
            {
                return retExecResult(Constants.ExecResult.Succ, "数据不存在，获取信息成功！", model);
            }
            else
            {
                return retExecResult(Constants.ExecResult.Error, "数据不存在，获取信息失败！", "");
            }
        }
        catch (Exception ex)
        {
            return retExecResult(Constants.ExecResult.Error, ex.Message, "");
        }
    }

    //*******************************************
    //功能概要       ：获得贷款一览
    //参数説明       ：context 请求的上下文
    //返回值説明     ：无
    //功能詳細       ：获得获得贷款一览一览
    //作成者         ：zou.xiaochun
    //作成日         ：2010-08-06
    //*******************************************
    private string Search(HttpContext context)
    {
        try
        {
            //页码
            int strPageIndex = (string.IsNullOrEmpty(context.Request["pageindex"])) ? 1 : int.Parse(context.Request["pageindex"]) + 1;
            //页显示行数
            int strPageSize = (string.IsNullOrEmpty(context.Request["pagesize"])) ? 15 : int.Parse(context.Request["pagesize"]);
            //查询条件
            string sqlWhere = GenerateCondition(context);

            //查询分页信息
            Chenxin.Lib.Business.BLL.PreLoanInfo bllLoan = new Chenxin.Lib.Business.BLL.PreLoanInfo();
            System.Data.DataSet ds = bllLoan.GetModelListByCoditions(sqlWhere, strPageIndex, strPageSize);

            //总页数
            int count = (int)ds.Tables[1].Rows[0][0];
            return string.Format("{{success:'1',msg:'{0}',data:{{count:'{1}',{2}}}}}", Resources.Message.Global_Msg_SUCCESS, count, JsonHelp.Convert2Json(ds.Tables[0]));
        }
        catch (Exception ex)
        {
            return string.Format("{{success:'0',msg:'{0}：{1}',data:''}}", Resources.Message.Global_Err_Exception, ex.Message);
        }
    }

    //*******************************************
    //功能概要       ：查询权限
    //参数説明       ：context 请求上下文
    //返回值説明     ：程序处理信息提示
    //功能詳細       ：生成查询条件语句
    //作成者         ：chen.yugong
    //作成日         ：2010-06-29
    //修改者         ：王玮
    //修改日         ：2010-07-13
    //*******************************************
    public string GenerateCondition(HttpContext context)
    {
        try
        {
            //获取页面查询条件
            Guid city = (string.IsNullOrEmpty(context.Request["cityid"])) ? CurrentUserInfo.CityId : new Guid(context.Request["cityid"]);
            Guid company = (string.IsNullOrEmpty(context.Request["companyid"])) ? CurrentUserInfo.CompanyId : new Guid(context.Request["companyid"]);
            Guid businessdistrict = (string.IsNullOrEmpty(context.Request["areaid"])) ? Guid.Empty : new Guid(context.Request["areaid"]);
            Guid departs = (string.IsNullOrEmpty(context.Request["departid"])) ? Guid.Empty : new Guid(context.Request["departid"]);
            Guid employee = (string.IsNullOrEmpty(context.Request["userid"])) ? Guid.Empty : new Guid(context.Request["userid"]);
            string starttime = context.Request.QueryString["DateFr"];
            string endtime = context.Request.QueryString["DateTo"];
            string contractcode = context.Request.QueryString["ContractCode"];
            string strDateType = context.Request["DateType"];
            string strLoanType = context.Request["LoanInfo"];
            string strLoanContractDate = context.Request["LoanContractDate"];
            string keyword = context.Request.QueryString["KeyWord"];
            string strStatus = context.Request.QueryString["Status"];
            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            //判断级联菜单
            if (employee != Guid.Empty)
                sb.AppendFormat(" and (a.EmployeeId = '{0}') ", employee);
            else if (departs != Guid.Empty)
                sb.AppendFormat(" and (a.EmpDepartId = '{0}')", departs);
            else if (businessdistrict != Guid.Empty)
            {
                Chenxin.Lib.Hr.Entity.Hr_DepartmentInfo item = null;
                string strCachkey = string.Format(Chenxin.Lib.Cache.CacheDataType.GLOBAL_DEPARTMENT, businessdistrict);
                Chenxin.Lib.Cache.CacheService cs = new Chenxin.Lib.Cache.CacheService(Chenxin.Lib.Cache.CacheConn.xCacheConn.GLOBAL);
                item = cs.GetObject<Chenxin.Lib.Hr.Entity.Hr_DepartmentInfo>(strCachkey);
                if (!cs.Hit)
                {
                    item = Chenxin.Lib.Hr.DAL.Hr_DepartmentInfo.GetModel(businessdistrict);
                    if (item != null) cs.Set(strCachkey, item, DateTime.Now.AddDays(1));
                }

                if (item == null) return string.Format("{{success:'0',msg:'{0}',data:''}}", Resources.Message.Global_Err_GetBusDis);

                sb.AppendFormat(" and (a.EmpDepartId in (select departId from v_Hr_DepartmentInfo where DepartSrc like '{0}%'))", item.DepartSrc);
            }
            else if (company != Guid.Empty)
            {
                sb.AppendFormat(" and a.EmpCompanyId = '{0}'", company);
            }
            else if (city != Guid.Empty)
            {
                sb.AppendFormat(" and a.EmpCityId = '{0}'", city);
            }
            else
            {
                sb.AppendFormat(" and a.EmpCompanyId = '{0}'", CurrentUserInfo.CompanyId);
            }

            //查询权限判断权限
            System.Text.StringBuilder sb1 = new System.Text.StringBuilder();
            if (CurrentUserInfo.ContainsPermit(Constants.Permit_LoanSearch_All))
            {
                sb1.Append(" (1=1) ");
            }
            else if (CurrentUserInfo.ContainsPermit(Constants.Permit_LoanSearch_City))
            {
                sb1.AppendFormat(" (a.EmpCityId = '{0}')", CurrentUserInfo.CityId);
            }
            else if (CurrentUserInfo.ContainsPermit(Constants.Permit_LoanSearch_Company))
            {
                sb1.AppendFormat(" (a.EmpCompanyId = '{0}')", CurrentUserInfo.CompanyId);
            }
            else if (CurrentUserInfo.ContainsPermit(Constants.Permit_LoanSearch_Depart))
            {
                sb1.Append(" (EXISTS(");
                sb1.AppendFormat("Select 1 from t_Business_EmpSetting M WHERE a.EmpDepartId=M.DepartId And M.Userid= '{0}' and SearchLoan=1", CurrentUserInfo.UserId.ToString());
                sb1.Append(")) ");
            }
            else
            {
                sb1.AppendFormat(" (a.EmployeeId = '{0}')", CurrentUserInfo.UserId);
            }

            if (!String.IsNullOrEmpty(sb.ToString()))
                sb1.Append(sb.ToString());

            //日期类型+日期
            if (!String.IsNullOrEmpty(strDateType))
            {
                switch (strDateType)
                {
                    case "签订贷款合同日期":
                        //签订贷款合同日期开始
                        if (!String.IsNullOrEmpty(starttime))
                        {
                            sb1.Append(string.Format(" and a.LoanContractDate >= cast('{0}' as datetime)", (starttime)));
                        }
                        //签订贷款合同日期结束
                        if (!String.IsNullOrEmpty(endtime))
                        {
                            sb1.Append(string.Format(" and a.LoanContractDate < cast('{0}' as datetime)", (endtime)));
                        }
                        break;
                    case "评估费收款日期":
                        //评估费收款日期开始
                        if (!String.IsNullOrEmpty(starttime))
                        {
                            sb1.Append(string.Format(" and a.EvaluateFeeDate >= cast('{0}' as datetime)", (starttime)));
                        }
                        //评估费收款日期结束
                        if (!String.IsNullOrEmpty(endtime))
                        {
                            sb1.Append(string.Format(" and a.EvaluateFeeDate < cast('{0}' as datetime)", (endtime)));
                        }
                        break;
                    case "代理费收款日期":
                        //代理费收款日期开始
                        if (!String.IsNullOrEmpty(starttime))
                        {
                            sb1.Append(string.Format(" and a.AgencyFeeDate >= cast('{0}' as datetime)", (starttime)));
                        }
                        //代理费收款日期结束
                        if (!String.IsNullOrEmpty(endtime))
                        {
                            sb1.Append(string.Format(" and a.AgencyFeeDate < cast('{0}' as datetime)", (endtime)));
                        }
                        break;
                    case "担保费收款日期":
                        //担保费收款日期开始
                        if (!String.IsNullOrEmpty(starttime))
                        {
                            sb1.Append(string.Format(" and a.OutVouchFeeDate >= cast('{0}' as datetime)", (starttime)));
                        }
                        //担保费收款日期结束
                        if (!String.IsNullOrEmpty(endtime))
                        {
                            sb1.Append(string.Format(" and a.OutVouchFeeDate < cast('{0}' as datetime)", (endtime)));
                        }
                        break;
                    case "贷款合同送银行日期":
                        //贷款合同送银行日期开始
                        if (!String.IsNullOrEmpty(starttime))
                        {
                            sb1.Append(string.Format(" and a.BankLoanDate >= cast('{0}' as datetime)", (starttime)));
                        }
                        //贷款合同送银行日期结束
                        if (!String.IsNullOrEmpty(endtime))
                        {
                            sb1.Append(string.Format(" and a.BankLoanDate < cast('{0}' as datetime)", (endtime)));
                        }
                        break;
                    case "银行合同回公司日期":
                        //银行合同回公司日期开始
                        if (!String.IsNullOrEmpty(starttime))
                        {
                            sb1.Append(string.Format(" and a.ReceiveLoanDate >= cast('{0}' as datetime)", (starttime)));
                        }
                        //银行合同回公司日期结束
                        if (!String.IsNullOrEmpty(endtime))
                        {
                            sb1.Append(string.Format(" and a.ReceiveLoanDate < cast('{0}' as datetime)", (endtime)));
                        }
                        break;
                    case "评估报告回公司日期":
                        //评估报告回公司日期开始
                        if (!String.IsNullOrEmpty(starttime))
                        {
                            sb1.Append(string.Format(" and a.EstimReportBackDate >= cast('{0}' as datetime)", (starttime)));
                        }
                        //评估报告回公司日期结束
                        if (!String.IsNullOrEmpty(endtime))
                        {
                            sb1.Append(string.Format(" and a.EstimReportBackDate < cast('{0}' as datetime)", (endtime)));
                        }
                        break;
                    case "放款材料回公司日期":
                        //放款材料回公司日期开始
                        if (!String.IsNullOrEmpty(starttime))
                        {
                            sb1.Append(string.Format(" and a.CompleteLoanDate >= cast('{0}' as datetime)", (starttime)));
                        }
                        //放款材料回公司日期结束
                        if (!String.IsNullOrEmpty(endtime))
                        {
                            sb1.Append(string.Format(" and a.CompleteLoanDate < cast('{0}' as datetime)", (endtime)));
                        }
                        break;
                    case "抵押证送银行日期":
                        //抵押证送银行日期开始
                        if (!String.IsNullOrEmpty(starttime))
                        {
                            sb1.Append(string.Format(" and a.CertificateDate >= cast('{0}' as datetime)", (starttime)));
                        }
                        //抵押证送银行日期结束
                        if (!String.IsNullOrEmpty(endtime))
                        {
                            sb1.Append(string.Format(" and a.CertificateDate < cast('{0}' as datetime)", (endtime)));
                        }
                        break;
                    case "银行放款日期":
                        //银行放款日期开始
                        if (!String.IsNullOrEmpty(starttime))
                        {
                            sb1.Append(string.Format(" and a.BankCompleteDate >= cast('{0}' as datetime)", (starttime)));
                        }
                        //银行放款日期结束
                        if (!String.IsNullOrEmpty(endtime))
                        {
                            sb1.Append(string.Format(" and a.BankCompleteDate < cast('{0}' as datetime)", (endtime)));
                        }
                        break;
                    case "成交日期":
                        //成交日期开始
                        if (!String.IsNullOrEmpty(starttime))
                        {
                            sb1.Append(string.Format(" and b.ContractDate >= cast('{0}' as datetime)", (starttime)));
                        }
                        //成交日期结束
                        if (!String.IsNullOrEmpty(endtime))
                        {
                            sb1.Append(string.Format(" and b.ContractDate < cast('{0}' as datetime)", (endtime)));
                        }
                        break;
                }
            }

            //贷款情况
            if (!String.IsNullOrEmpty(strLoanType))
            {
                switch (strLoanType)
                {
                    case "收件收据贷款":
                        sb1.Append(string.Format(" and c.LoanInfo = '收件收据贷款'"));
                        break;
                    case "普通贷款":
                        sb1.Append(string.Format(" and c.LoanInfo = '普通贷款'"));
                        break;
                    case "转按揭贷款":
                        sb1.Append(string.Format(" and c.LoanInfo = '转按揭贷款'"));
                        break;
                    case "一次性付款":
                        sb1.Append(string.Format(" and c.LoanInfo = '一次性付款'"));
                        break;
                    case "消费贷款":
                        sb1.Append(string.Format(" and c.LoanInfo = '消费贷款'"));
                        break;
                }
                //switch (strLoanType)
                //{
                //    case "收件收据贷款":
                //        sb1.Append(string.Format(" and a.Receipt = 1 and a.Mortgage = 0"));
                //        break;
                //    case "普通贷款":
                //        sb1.Append(string.Format(" and a.Receipt = 0 and a.Mortgage = 0"));
                //        break;
                //    case "转按揭贷款":
                //        sb1.Append(string.Format(" and a.Mortgage = 1"));
                //        break;
                //}
            }

            //成交编号
            if (!String.IsNullOrEmpty(contractcode))
            {
                sb1.AppendFormat(" And a.ContractCode like '%{0}%'", contractcode);
            }

            //贷款合同签订日期
            if (!String.IsNullOrEmpty(strLoanContractDate))
            {
                sb1.AppendFormat(" And a.LoanContractDate = '{0}'", strLoanContractDate);
            }

            //关键字
            if (!String.IsNullOrEmpty(keyword))
            {
                sb1.AppendFormat(" And ((a.Address LIKE '%{0}%') Or(a.CustomerName like '%{0}%') Or(a.ReceiveBank like '%{0}%'))", keyword);
            }

            //状态
            if (!String.IsNullOrEmpty(strStatus))
            {
                if (strStatus=="已撤销")
                sb1.AppendFormat(" And a.Status = -1 ");
            }
            else
            {
                sb1.Append(" And a.Status <> -1 ");
            }
            
            return sb1.ToString();
        }
        catch (Exception ex)
        {
            return string.Format("{{success:'0',msg:'{0}：{1}',data:''}}", Resources.Message.Global_Err_Exception, ex.Message);
        }
    }

    //*******************************************
    //功能概要       ：撤销预审
    //参数説明       ：context 请求的上下文
    //返回值説明     ：无
    //功能詳細       ：撤销预审
    //作成者         ：zou.xiaochun
    //作成日         ：2010-07-15
    //*******************************************
    private string DelPre(HttpContext context)
    {
        //贷款处理业务类
        PreLoanInfo bllPreLoan = new PreLoanInfo();

        //预审信息
        Chenxin.Lib.Business.Entity.t_Preliminary_SubInfo3 entOldPreLoan = bllPreLoan.GetModelByRecordId(new Guid(context.Request["modelid"]));
        Chenxin.Lib.Business.Entity.t_Preliminary_SubInfo3 entPreLoan = new Chenxin.Lib.Business.Entity.t_Preliminary_SubInfo3();

        if (entOldPreLoan == null || entOldPreLoan.Status == -1)
        {
            return retExecResult(Constants.ExecResult.Error, "此贷款已经被撤销！", "");
        }
        entPreLoan.RecordId = new Guid(context.Request["modelid"]);
        entPreLoan = CompletePreLoan(entPreLoan, entPreLoan.RecordId.ToString(),"撤销贷款");

        //①贷款信息录入
        bllPreLoan.Update(entPreLoan);
        string text = CurrentUserInfo.UserName + "：撤销贷款。房源：" + entPreLoan.Address;
        AddLog(text, BusinessType.BusinessTypeComboList()["OprType_DelLoan"].ToString());
        return retExecResult(Constants.ExecResult.Succ, Resources.Message.Msg_Del_LoanSucc, "");
    }

    //*******************************************
    //功能概要       ：恢复撤销
    //参数説明       ：context 请求的上下文
    //返回值説明     ：无
    //功能詳細       ：恢复撤销
    //作成者         ：zou.xiaochun
    //作成日         ：2010-08-03
    //*******************************************
    private string ResPre(HttpContext context)
    {
        //贷款处理业务类
        PreLoanInfo bllPreLoan = new PreLoanInfo();

        //贷款处理
        Chenxin.Lib.Business.Entity.t_Preliminary_SubInfo3 entPreLoan = new Chenxin.Lib.Business.Entity.t_Preliminary_SubInfo3();
        Chenxin.Lib.Business.Entity.t_Preliminary_SubInfo3 entOldPreLoan = bllPreLoan.GetModelByRecordId(new Guid(context.Request["modelid"]));
        if (entOldPreLoan.Status != -1)
        {
            return retExecResult(Constants.ExecResult.Error, "此预审并没有被撤销！", "");
        }
        entPreLoan.RecordId = new Guid(context.Request["modelid"]);
        entPreLoan = CompletePreLoan(entPreLoan, entPreLoan.RecordId.ToString(), "恢复撤销");

        //①预审信息录入
        bllPreLoan.Update(entPreLoan);
        string text = CurrentUserInfo.UserName + "：恢复撤销。房源：" + entPreLoan.Address;
        AddLog(text, BusinessType.BusinessTypeComboList()["OprType_ResLoan"].ToString());
        return retExecResult(Constants.ExecResult.Succ, Resources.Message.Msg_Res_LoanSucc, "");
    }
    
    //*******************************************
    //功能概要       ：转化为翻页结构体格式
    //参数説明       ：dtData 要转化的原始数据
    //               ：intShowRows 一页所要显示的条数
    //               ：intCurPage 当前的页码
    //               ：intTotal 数据总条数
    //返回值説明     ：翻页结构体
    //功能詳細       ：转化为翻页结构体格式
    //作成者         ：zou.xiaochu
    //作成日         ：2010-07-14 
    //*******************************************
    public Constants.Pagination GetJson(System.Data.DataSet dsData)
    {
        Constants.Pagination stuPag = new Constants.Pagination();
        System.Data.DataRow row;
        DateTime dtTempTime;

        System.Text.StringBuilder strData = new System.Text.StringBuilder();


        for (int idxRow = 0; idxRow < dsData.Tables[0].Rows.Count; idxRow++)
        {
            row = dsData.Tables[0].Rows[idxRow];

            strData.AppendFormat("<dl id=\"{0}\">", row["RecordId"].ToString());
            strData.AppendFormat("<dd style=\"display: none;\">{0}</dd>", row["RecordId"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["ContractCode"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["LoanCode"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["LoanDealMode"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["LoanInfo"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["CustomerName"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["IDNum"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["Address"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["SalePrice_T"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["BuildingArea"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["GJJmoney"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["GJJyear"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["SYMoney"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["SYYear"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["LoanXf"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["LoanXfYear"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["LoanSx"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["LoanSxYear"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["LoanZy"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["LoanZyYear"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["ReceiveBank"].ToString());
            if (!string.IsNullOrEmpty(row["SLDate"].ToString()))
            {
                dtTempTime = (DateTime)row["SLDate"];
                strData.AppendFormat("<dd>{0}</dd>", dtTempTime.Year.ToString().PadLeft(4, '0') + "-" +
                                                     dtTempTime.Month.ToString().PadLeft(2, '0') + "-" +
                                                     dtTempTime.Day.ToString().PadLeft(2, '0'));
            }
            else
            {
                strData.Append("<dd></dd>");
            }
            if (!string.IsNullOrEmpty(row["BankLoanDate"].ToString()))
            {
                dtTempTime = (DateTime)row["BankLoanDate"];
                strData.AppendFormat("<dd>{0}</dd>", dtTempTime.Year.ToString().PadLeft(4, '0') + "-" +
                                                     dtTempTime.Month.ToString().PadLeft(2, '0') + "-" +
                                                     dtTempTime.Day.ToString().PadLeft(2, '0'));
            }
            else
            {
                strData.Append("<dd></dd>");
            }
            if (!string.IsNullOrEmpty(row["ReceiveLoanDate"].ToString()))
            {
                dtTempTime = (DateTime)row["ReceiveLoanDate"];
                strData.AppendFormat("<dd>{0}</dd>", dtTempTime.Year.ToString().PadLeft(4, '0') + "-" +
                                                     dtTempTime.Month.ToString().PadLeft(2, '0') + "-" +
                                                     dtTempTime.Day.ToString().PadLeft(2, '0'));
            }
            else
            {
                strData.Append("<dd></dd>");
            }
            if (!string.IsNullOrEmpty(row["CompleteLoanDate"].ToString()))
            {
                dtTempTime = (DateTime)row["CompleteLoanDate"];
                strData.AppendFormat("<dd>{0}</dd>", dtTempTime.Year.ToString().PadLeft(4, '0') + "-" +
                                                     dtTempTime.Month.ToString().PadLeft(2, '0') + "-" +
                                                     dtTempTime.Day.ToString().PadLeft(2, '0'));
            }
            else
            {
                strData.Append("<dd></dd>");
            }
            if (!string.IsNullOrEmpty(row["EstimReportBackDate"].ToString()))
            {
                dtTempTime = (DateTime)row["EstimReportBackDate"];
                strData.AppendFormat("<dd>{0}</dd>", dtTempTime.Year.ToString().PadLeft(4, '0') + "-" +
                                                     dtTempTime.Month.ToString().PadLeft(2, '0') + "-" +
                                                     dtTempTime.Day.ToString().PadLeft(2, '0'));
            }
            else
            {
                strData.Append("<dd></dd>");
            }
            if (!string.IsNullOrEmpty(row["VoucherToBankDate"].ToString()))
            {
                dtTempTime = (DateTime)row["VoucherToBankDate"];
                strData.AppendFormat("<dd>{0}</dd>", dtTempTime.Year.ToString().PadLeft(4, '0') + "-" +
                                                     dtTempTime.Month.ToString().PadLeft(2, '0') + "-" +
                                                     dtTempTime.Day.ToString().PadLeft(2, '0'));
            }
            else
            {
                strData.Append("<dd></dd>");
            }
            if (!string.IsNullOrEmpty(row["CertificateDate"].ToString()))
            {
                dtTempTime = (DateTime)row["CertificateDate"];
                strData.AppendFormat("<dd>{0}</dd>", dtTempTime.Year.ToString().PadLeft(4, '0') + "-" +
                                                     dtTempTime.Month.ToString().PadLeft(2, '0') + "-" +
                                                     dtTempTime.Day.ToString().PadLeft(2, '0'));
            }
            else
            {
                strData.Append("<dd></dd>");
            }
            if (!string.IsNullOrEmpty(row["BankCompleteDate"].ToString()))
            {
                dtTempTime = (DateTime)row["BankCompleteDate"];
                strData.AppendFormat("<dd>{0}</dd>", dtTempTime.Year.ToString().PadLeft(4, '0') + "-" +
                                                     dtTempTime.Month.ToString().PadLeft(2, '0') + "-" +
                                                     dtTempTime.Day.ToString().PadLeft(2, '0'));
            }
            else
            {
                strData.Append("<dd></dd>");
            }
            strData.AppendFormat("<dd>{0}</dd>", row["EvaluateFee"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["EvaluateCorp"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["InsuranceFee"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["InsuranceCorp"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["AgencyFee"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["OutVouchFee"].ToString());
            //strData.AppendFormat("<dd>{0}</dd>", row["EmpCompanyName"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["EmpDepartName"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["EmployeeName"].ToString());
            strData.AppendFormat("<dd>{0}</dd>", row["EmpPhone"].ToString());
            if (!string.IsNullOrEmpty(row["TJPercent"].ToString()))
            {
                strData.AppendFormat("<dd>{0}</dd>", row["TJPercent"].ToString() + "%");
            }
            else
            {
                strData.Append("<dd></dd>");
            }
            strData.AppendFormat("<dd>{0}</dd>", row["TJMoney"].ToString());
            if (!string.IsNullOrEmpty(row["TJDate"].ToString()))
            {
                dtTempTime = (DateTime)row["TJDate"];
                strData.AppendFormat("<dd>{0}</dd>", dtTempTime.Year.ToString().PadLeft(4, '0') + "-" +
                                                     dtTempTime.Month.ToString().PadLeft(2, '0') + "-" +
                                                     dtTempTime.Day.ToString().PadLeft(2, '0'));
            }
            else
            {
                strData.Append("<dd></dd>");
            }
            strData.Append("</dl>");
        }

        stuPag.count = Convert.ToInt32(dsData.Tables[1].Rows[0][0]);
        stuPag.data = strData.ToString();
        return stuPag;
    }
    
    //*******************************************
    //功能概要       ：贷款奖励
    //参数説明       ：context 请求上下文
    //返回值説明     ：程序处理信息提示
    //功能詳細       ：贷款奖励相关信息
    //作成者         ：zou.xiaochun
    //作成日         ：2010-08-09
    //*******************************************
    private string LoanEncouragement(HttpContext context)
    {
        //贷款处理
        string PreLoan = context.Request.Params["model"];

        //贷款处理业务类
        PreLoanInfo bllPreLoan = new PreLoanInfo();

        //贷款处理信息
        Chenxin.Lib.Business.Entity.t_Preliminary_SubInfo3 entPreLoan = new Chenxin.Lib.Business.Entity.t_Preliminary_SubInfo3();

        //贷款处理信息
        entPreLoan = (Chenxin.Lib.Business.Entity.t_Preliminary_SubInfo3)JsonHelp.Convert2Entity(PreLoan,
                        typeof(Chenxin.Lib.Business.Entity.t_Preliminary_SubInfo3));

        entPreLoan = CompletePreLoan(entPreLoan, entPreLoan.RecordId.ToString(), "贷款奖励");
        bllPreLoan.Update(entPreLoan);
        string text = CurrentUserInfo.UserName + "：贷款奖励。房源" + entPreLoan.Address;
        AddLog(text, BusinessType.BusinessTypeComboList()["OprType_LoanEncouragement"].ToString());
        return retExecResult(Constants.ExecResult.Succ, Resources.Message.Msg_Loan_EncouragementSucc, "");
    }

    //*******************************************
    //功能概要       ：填充预审信息字段
    //参数説明       ：context 请求上下文
    //返回值説明     ：预审信息实体
    //功能詳細       ：填充预审信息字段
    //作成者         ：zou.xiaochun
    //作成日         ：2010-07-09
    //*******************************************
    private Chenxin.Lib.Business.Entity.t_Preliminary_SubInfo3 CompletePreLoan(Chenxin.Lib.Business.Entity.t_Preliminary_SubInfo3 entPreLoan, string RecordId,string status)
    {
        Chenxin.Lib.Business.BLL.PreLoanInfo bllPreLoan = new Chenxin.Lib.Business.BLL.PreLoanInfo();
        Chenxin.Lib.Business.Entity.t_Preliminary_SubInfo3 entOldPreLoan = bllPreLoan.GetLoanModel(new Guid(RecordId));

        switch (status)
        {
            case "贷款奖励":
                entPreLoan.RecordId = entOldPreLoan.RecordId;
                entPreLoan.MainId = entOldPreLoan.MainId;
                entPreLoan.LoanCode = entOldPreLoan.LoanCode;
                entPreLoan.LoanInfo = entOldPreLoan.LoanInfo;
                entPreLoan.Address = entOldPreLoan.Address;
                entPreLoan.LackInfo = entOldPreLoan.LackInfo;
                entPreLoan.SalePrice_T = entOldPreLoan.SalePrice_T;
                entPreLoan.EvaluateFeeDate = entOldPreLoan.EvaluateFeeDate;
                entPreLoan.ContractId = entOldPreLoan.ContractId;
                entPreLoan.ContractCode = entOldPreLoan.ContractCode;
                entPreLoan.LoanDealMode = entOldPreLoan.LoanDealMode;
                entPreLoan.EvaluateCorp = entOldPreLoan.EvaluateCorp;
                entPreLoan.EvaluateFee = entOldPreLoan.EvaluateFee;
                entPreLoan.InsuranceCorp = entOldPreLoan.InsuranceCorp;
                entPreLoan.InsuranceFee = entOldPreLoan.InsuranceFee;
                entPreLoan.AgencyFee = entOldPreLoan.AgencyFee;
                entPreLoan.ReceiveBank = entOldPreLoan.ReceiveBank;
                entPreLoan.OutVouchFee = entOldPreLoan.OutVouchFee;
                entPreLoan.VouchFee = entOldPreLoan.VouchFee;
                entPreLoan.LoanXf = entOldPreLoan.LoanXf;
                entPreLoan.LoanXfYear = entOldPreLoan.LoanXfYear;
                entPreLoan.LoanSx = entOldPreLoan.LoanSx;
                entPreLoan.LoanSxYear = entOldPreLoan.LoanSxYear;
                entPreLoan.LoanZy = entOldPreLoan.LoanZy;
                entPreLoan.LoanZyYear = entOldPreLoan.LoanZyYear;
                entPreLoan.BankQueryFee = entOldPreLoan.BankQueryFee;
                entPreLoan.BankManageFee = entOldPreLoan.BankManageFee;
                entPreLoan.Remark = entOldPreLoan.Remark;
                entPreLoan.SLRemark = entOldPreLoan.SLRemark;
                entPreLoan.SHRemark = entOldPreLoan.SHRemark;
                entPreLoan.FKRemark = entOldPreLoan.FKRemark;
                entPreLoan.BankLoanDate = entOldPreLoan.BankLoanDate;
                entPreLoan.ReceiveLoanDate = entOldPreLoan.ReceiveLoanDate;
                entPreLoan.LoanBankSaleComplete = entOldPreLoan.LoanBankSaleComplete;
                entPreLoan.LoanContractDate = entOldPreLoan.LoanContractDate;
                entPreLoan.MortgageClearDate = entOldPreLoan.MortgageClearDate;
                entPreLoan.LoanComplete = entOldPreLoan.LoanComplete;
                entPreLoan.SendToBankDate = entOldPreLoan.SendToBankDate;
                entPreLoan.VouchFeeDate = entOldPreLoan.VouchFeeDate;
                entPreLoan.VoucherToBankDate = entOldPreLoan.VoucherToBankDate;
                entPreLoan.BankCompleteDate = entOldPreLoan.BankCompleteDate;
                entPreLoan.CompleteLoanDate = entOldPreLoan.CompleteLoanDate;
                entPreLoan.CertificateDate = entOldPreLoan.CertificateDate;
                entPreLoan.InsuranceFeeDate = entOldPreLoan.InsuranceFeeDate;
                entPreLoan.AgencyFeeDate = entOldPreLoan.AgencyFeeDate;
                entPreLoan.OutVouchFeeDate = entOldPreLoan.OutVouchFeeDate;
                entPreLoan.EndDate = entOldPreLoan.EndDate;
                entPreLoan.EstimReportBackDate = entOldPreLoan.EstimReportBackDate;
                entPreLoan.IsNoEvaluateFee = entOldPreLoan.IsNoEvaluateFee;
                entPreLoan.IdBankReceipt = entOldPreLoan.IdBankReceipt;
                entPreLoan.IdZhuanBen = entOldPreLoan.IdZhuanBen;
                entPreLoan.IsNoAgencyFee = entOldPreLoan.IsNoAgencyFee;
                entPreLoan.IdShouBen = entOldPreLoan.IdShouBen;
                entPreLoan.IsLack = entOldPreLoan.IsLack;
                entPreLoan.EstimatePrice = entOldPreLoan.EstimatePrice;
                entPreLoan.BuildingArea = entOldPreLoan.BuildingArea;
                entPreLoan.CompleteYear = entOldPreLoan.CompleteYear;
                entPreLoan.Total_Floor = entOldPreLoan.Total_Floor;
                entPreLoan.CustomerName = entOldPreLoan.CustomerName;
                entPreLoan.IDNum = entOldPreLoan.IDNum;
                entPreLoan.GJJmoney = entOldPreLoan.GJJmoney;
                entPreLoan.GJJyear = entOldPreLoan.GJJyear;
                entPreLoan.SYMoney = entOldPreLoan.SYMoney;
                entPreLoan.SYYear = entOldPreLoan.SYYear;
                entPreLoan.OrderPlace = entOldPreLoan.OrderPlace;
                entPreLoan.Receipt = entOldPreLoan.Receipt;
                entPreLoan.Mortgage = entOldPreLoan.Mortgage;
                entPreLoan.SaleName = entOldPreLoan.SaleName;
                entPreLoan.SaleIDCard = entOldPreLoan.SaleIDCard;
                entPreLoan.SalerPhone = entOldPreLoan.SalerPhone;
                entPreLoan.BuyerPhone = entOldPreLoan.BuyerPhone;
                entPreLoan.OldLoanBank = entOldPreLoan.OldLoanBank;
                entPreLoan.OldLoanMoney = entOldPreLoan.OldLoanMoney;
                entPreLoan.OldRestMoney = entOldPreLoan.OldRestMoney;
                entPreLoan.EmpCompanyId = entOldPreLoan.EmpCompanyId;
                entPreLoan.EmpCompanyName = entOldPreLoan.EmpCompanyName;
                entPreLoan.EmpDepartId = entOldPreLoan.EmpDepartId;
                entPreLoan.EmpDepartName = entOldPreLoan.EmpDepartName;
                entPreLoan.EmployeeId = entOldPreLoan.EmployeeId;
                entPreLoan.EmployeeName = entOldPreLoan.EmployeeName;
                entPreLoan.EmpPhone = entOldPreLoan.EmpPhone;
                entPreLoan.SLDate = entOldPreLoan.SLDate;
                entPreLoan.UpSLDate = entOldPreLoan.UpSLDate;
                entPreLoan.SHDate = entOldPreLoan.SHDate;
                entPreLoan.UpSHDate = entOldPreLoan.UpSHDate;
                entPreLoan.FKDate = entOldPreLoan.FKDate;
                entPreLoan.UpFKDate = entOldPreLoan.UpFKDate;
                entPreLoan.Status = entOldPreLoan.Status;
                entPreLoan.OperateCompanyId = CurrentUserInfo.CompanyId;
                entPreLoan.OperateCompanyName = CurrentUserInfo.CompanyName;
                entPreLoan.OperateDepartId = CurrentUserInfo.DepartId;
                entPreLoan.OperateDepartName = CurrentUserInfo.DepartName;
                entPreLoan.OperateUserId = CurrentUserInfo.UserId;
                entPreLoan.OperateUserName = CurrentUserInfo.UserName;
                break;
            case "撤销贷款":
                entPreLoan.RecordId = entOldPreLoan.RecordId;
                entPreLoan.MainId = entOldPreLoan.MainId;
                entPreLoan.OperateCompanyId = entOldPreLoan.OperateCompanyId;
                entPreLoan.OperateDepartId = entOldPreLoan.OperateDepartId;
                entPreLoan.OperateUserId = entOldPreLoan.OperateUserId;
                entPreLoan.EmpCityId = entOldPreLoan.EmpCityId;
                entPreLoan.EmpCompanyId = entOldPreLoan.EmpCompanyId;
                entPreLoan.EmpDepartId = entOldPreLoan.EmpDepartId;
                entPreLoan.EmployeeId = entOldPreLoan.EmployeeId;
                entPreLoan.ContractId = entOldPreLoan.ContractId;
                entPreLoan.ContractCode = entOldPreLoan.ContractCode;
                entPreLoan.LoanCode = entOldPreLoan.LoanCode;
                entPreLoan.LoanInfo = entOldPreLoan.LoanInfo;
                entPreLoan.LoanDealMode = entOldPreLoan.LoanDealMode;
                entPreLoan.EvaluateCorp = entOldPreLoan.EvaluateCorp;
                entPreLoan.InsuranceCorp = entOldPreLoan.InsuranceCorp;
                entPreLoan.ReceiveBank = entOldPreLoan.ReceiveBank;
                entPreLoan.LoanXfYear = entOldPreLoan.LoanXfYear;
                entPreLoan.LoanSxYear = entOldPreLoan.LoanSxYear;
                entPreLoan.LoanZyYear = entOldPreLoan.LoanZyYear;
                entPreLoan.SalerPhone = entOldPreLoan.SalerPhone;
                entPreLoan.BuyerPhone = entOldPreLoan.BuyerPhone;
                entPreLoan.OperateCompanyName = entOldPreLoan.OperateCompanyName;
                entPreLoan.OperateDepartName = entOldPreLoan.OperateDepartName;
                entPreLoan.OperateUserName = entOldPreLoan.OperateUserName;
                entPreLoan.CustomerName = entOldPreLoan.CustomerName;
                entPreLoan.IDNum = entOldPreLoan.IDNum;
                entPreLoan.GJJyear = entOldPreLoan.GJJyear;
                entPreLoan.SYYear = entOldPreLoan.SYYear;
                entPreLoan.OrderPlace = entOldPreLoan.OrderPlace;
                entPreLoan.SaleName = entOldPreLoan.SaleName;
                entPreLoan.SaleIDCard = entOldPreLoan.SaleIDCard;
                entPreLoan.OldLoanBank = entOldPreLoan.OldLoanBank;
                entPreLoan.EmpCityName = entOldPreLoan.EmpCityName;
                entPreLoan.EmpCompanyName = entOldPreLoan.EmpCompanyName;
                entPreLoan.EmpDepartName = entOldPreLoan.EmpDepartName;
                entPreLoan.EmployeeName = entOldPreLoan.EmployeeName;
                entPreLoan.EmpPhone = entOldPreLoan.EmpPhone;
                entPreLoan.Address = entOldPreLoan.Address;
                entPreLoan.LackInfo = entOldPreLoan.LackInfo;
                entPreLoan.Remark = entOldPreLoan.Remark;
                entPreLoan.SLRemark = entOldPreLoan.SLRemark;
                entPreLoan.SHRemark = entOldPreLoan.SHRemark;
                entPreLoan.FKRemark = entOldPreLoan.FKRemark;
                entPreLoan.EvaluateFee = entOldPreLoan.EvaluateFee;
                entPreLoan.InsuranceFee = entOldPreLoan.InsuranceFee;
                entPreLoan.AgencyFee = entOldPreLoan.AgencyFee;
                entPreLoan.OutVouchFee = entOldPreLoan.OutVouchFee;
                entPreLoan.VouchFee = entOldPreLoan.VouchFee;
                entPreLoan.LoanXf = entOldPreLoan.LoanXf;
                entPreLoan.LoanSx = entOldPreLoan.LoanSx;
                entPreLoan.LoanZy = entOldPreLoan.LoanZy;
                entPreLoan.LoanBankSaleComplete = entOldPreLoan.LoanBankSaleComplete;
                entPreLoan.BankQueryFee = entOldPreLoan.BankQueryFee;
                entPreLoan.BankManageFee = entOldPreLoan.BankManageFee;
                entPreLoan.SalePrice_T = entOldPreLoan.SalePrice_T;
                entPreLoan.GJJmoney = entOldPreLoan.GJJmoney;
                entPreLoan.SYMoney = entOldPreLoan.SYMoney;
                entPreLoan.OldLoanMoney = entOldPreLoan.OldLoanMoney;
                entPreLoan.OldRestMoney = entOldPreLoan.OldRestMoney;
                entPreLoan.EstimatePrice = entOldPreLoan.EstimatePrice;
                entPreLoan.TJMoney = entOldPreLoan.TJMoney;
                entPreLoan.BuildingArea = entOldPreLoan.BuildingArea;
                entPreLoan.LoanContractDate = entOldPreLoan.LoanContractDate;
                entPreLoan.MortgageClearDate = entOldPreLoan.MortgageClearDate;
                entPreLoan.LoanComplete = entOldPreLoan.LoanComplete;
                entPreLoan.BankLoanDate = entOldPreLoan.BankLoanDate;
                entPreLoan.ReceiveLoanDate = entOldPreLoan.ReceiveLoanDate;
                entPreLoan.SendToBankDate = entOldPreLoan.SendToBankDate;
                entPreLoan.VoucherToBankDate = entOldPreLoan.VoucherToBankDate;
                entPreLoan.CertificateDate = entOldPreLoan.CertificateDate;
                entPreLoan.BankCompleteDate = entOldPreLoan.BankCompleteDate;
                entPreLoan.SLDate = entOldPreLoan.SLDate;
                entPreLoan.SHDate = entOldPreLoan.SHDate;
                entPreLoan.FKDate = entOldPreLoan.FKDate;
                entPreLoan.UpSLDate = entOldPreLoan.UpSLDate;
                entPreLoan.UpSHDate = entOldPreLoan.UpSHDate;
                entPreLoan.UpFKDate = entOldPreLoan.UpFKDate;
                entPreLoan.EvaluateFeeDate = entOldPreLoan.EvaluateFeeDate;
                entPreLoan.VouchFeeDate = entOldPreLoan.VouchFeeDate;
                entPreLoan.InsuranceFeeDate = entOldPreLoan.InsuranceFeeDate;
                entPreLoan.AgencyFeeDate = entOldPreLoan.AgencyFeeDate;
                entPreLoan.OutVouchFeeDate = entOldPreLoan.OutVouchFeeDate;
                entPreLoan.EndDate = entOldPreLoan.EndDate;
                entPreLoan.EstimReportBackDate = entOldPreLoan.EstimReportBackDate;
                entPreLoan.CompleteLoanDate = entOldPreLoan.CompleteLoanDate;
                entPreLoan.TJDate = entOldPreLoan.TJDate;
                entPreLoan.IsNoEvaluateFee = entOldPreLoan.IsNoEvaluateFee;
                entPreLoan.IdBankReceipt = entOldPreLoan.IdBankReceipt;
                entPreLoan.IdZhuanBen = entOldPreLoan.IdZhuanBen;
                entPreLoan.IsNoAgencyFee = entOldPreLoan.IsNoAgencyFee;
                entPreLoan.IdShouBen = entOldPreLoan.IdShouBen;
                entPreLoan.IsLack = entOldPreLoan.IsLack;
                entPreLoan.Mortgage = entOldPreLoan.Mortgage;
                entPreLoan.Mortgage = entOldPreLoan.Mortgage;
                entPreLoan.Total_Floor = entOldPreLoan.Total_Floor;
                entPreLoan.Total_Floor = entOldPreLoan.Total_Floor;
                entPreLoan.Status = -1;
                entPreLoan.TJPercent = entOldPreLoan.TJPercent;
                break;
            case "恢复撤销":
                entPreLoan.RecordId = entOldPreLoan.RecordId;
                entPreLoan.MainId = entOldPreLoan.MainId;
                entPreLoan.OperateCompanyId = entOldPreLoan.OperateCompanyId;
                entPreLoan.OperateDepartId = entOldPreLoan.OperateDepartId;
                entPreLoan.OperateUserId = entOldPreLoan.OperateUserId;
                entPreLoan.EmpCityId = entOldPreLoan.EmpCityId;
                entPreLoan.EmpCompanyId = entOldPreLoan.EmpCompanyId;
                entPreLoan.EmpDepartId = entOldPreLoan.EmpDepartId;
                entPreLoan.EmployeeId = entOldPreLoan.EmployeeId;
                entPreLoan.ContractId = entOldPreLoan.ContractId;
                entPreLoan.ContractCode = entOldPreLoan.ContractCode;
                entPreLoan.LoanCode = entOldPreLoan.LoanCode;
                entPreLoan.LoanInfo = entOldPreLoan.LoanInfo;
                entPreLoan.LoanDealMode = entOldPreLoan.LoanDealMode;
                entPreLoan.EvaluateCorp = entOldPreLoan.EvaluateCorp;
                entPreLoan.InsuranceCorp = entOldPreLoan.InsuranceCorp;
                entPreLoan.ReceiveBank = entOldPreLoan.ReceiveBank;
                entPreLoan.LoanXfYear = entOldPreLoan.LoanXfYear;
                entPreLoan.LoanSxYear = entOldPreLoan.LoanSxYear;
                entPreLoan.LoanZyYear = entOldPreLoan.LoanZyYear;
                entPreLoan.SalerPhone = entOldPreLoan.SalerPhone;
                entPreLoan.BuyerPhone = entOldPreLoan.BuyerPhone;
                entPreLoan.OperateCompanyName = entOldPreLoan.OperateCompanyName;
                entPreLoan.OperateDepartName = entOldPreLoan.OperateDepartName;
                entPreLoan.OperateUserName = entOldPreLoan.OperateUserName;
                entPreLoan.CustomerName = entOldPreLoan.CustomerName;
                entPreLoan.IDNum = entOldPreLoan.IDNum;
                entPreLoan.GJJyear = entOldPreLoan.GJJyear;
                entPreLoan.SYYear = entOldPreLoan.SYYear;
                entPreLoan.OrderPlace = entOldPreLoan.OrderPlace;
                entPreLoan.SaleName = entOldPreLoan.SaleName;
                entPreLoan.SaleIDCard = entOldPreLoan.SaleIDCard;
                entPreLoan.OldLoanBank = entOldPreLoan.OldLoanBank;
                entPreLoan.EmpCityName = entOldPreLoan.EmpCityName;
                entPreLoan.EmpCompanyName = entOldPreLoan.EmpCompanyName;
                entPreLoan.EmpDepartName = entOldPreLoan.EmpDepartName;
                entPreLoan.EmployeeName = entOldPreLoan.EmployeeName;
                entPreLoan.EmpPhone = entOldPreLoan.EmpPhone;
                entPreLoan.Address = entOldPreLoan.Address;
                entPreLoan.LackInfo = entOldPreLoan.LackInfo;
                entPreLoan.Remark = entOldPreLoan.Remark;
                entPreLoan.SLRemark = entOldPreLoan.SLRemark;
                entPreLoan.SHRemark = entOldPreLoan.SHRemark;
                entPreLoan.FKRemark = entOldPreLoan.FKRemark;
                entPreLoan.EvaluateFee = entOldPreLoan.EvaluateFee;
                entPreLoan.InsuranceFee = entOldPreLoan.InsuranceFee;
                entPreLoan.AgencyFee = entOldPreLoan.AgencyFee;
                entPreLoan.OutVouchFee = entOldPreLoan.OutVouchFee;
                entPreLoan.VouchFee = entOldPreLoan.VouchFee;
                entPreLoan.LoanXf = entOldPreLoan.LoanXf;
                entPreLoan.LoanSx = entOldPreLoan.LoanSx;
                entPreLoan.LoanZy = entOldPreLoan.LoanZy;
                entPreLoan.LoanBankSaleComplete = entOldPreLoan.LoanBankSaleComplete;
                entPreLoan.BankQueryFee = entOldPreLoan.BankQueryFee;
                entPreLoan.BankManageFee = entOldPreLoan.BankManageFee;
                entPreLoan.SalePrice_T = entOldPreLoan.SalePrice_T;
                entPreLoan.GJJmoney = entOldPreLoan.GJJmoney;
                entPreLoan.SYMoney = entOldPreLoan.SYMoney;
                entPreLoan.OldLoanMoney = entOldPreLoan.OldLoanMoney;
                entPreLoan.OldRestMoney = entOldPreLoan.OldRestMoney;
                entPreLoan.EstimatePrice = entOldPreLoan.EstimatePrice;
                entPreLoan.TJMoney = entOldPreLoan.TJMoney;
                entPreLoan.BuildingArea = entOldPreLoan.BuildingArea;
                entPreLoan.LoanContractDate = entOldPreLoan.LoanContractDate;
                entPreLoan.MortgageClearDate = entOldPreLoan.MortgageClearDate;
                entPreLoan.LoanComplete = entOldPreLoan.LoanComplete;
                entPreLoan.BankLoanDate = entOldPreLoan.BankLoanDate;
                entPreLoan.ReceiveLoanDate = entOldPreLoan.ReceiveLoanDate;
                entPreLoan.SendToBankDate = entOldPreLoan.SendToBankDate;
                entPreLoan.VoucherToBankDate = entOldPreLoan.VoucherToBankDate;
                entPreLoan.CertificateDate = entOldPreLoan.CertificateDate;
                entPreLoan.BankCompleteDate = entOldPreLoan.BankCompleteDate;
                entPreLoan.SLDate = entOldPreLoan.SLDate;
                entPreLoan.SHDate = entOldPreLoan.SHDate;
                entPreLoan.FKDate = entOldPreLoan.FKDate;
                entPreLoan.UpSLDate = entOldPreLoan.UpSLDate;
                entPreLoan.UpSHDate = entOldPreLoan.UpSHDate;
                entPreLoan.UpFKDate = entOldPreLoan.UpFKDate;
                entPreLoan.EvaluateFeeDate = entOldPreLoan.EvaluateFeeDate;
                entPreLoan.VouchFeeDate = entOldPreLoan.VouchFeeDate;
                entPreLoan.InsuranceFeeDate = entOldPreLoan.InsuranceFeeDate;
                entPreLoan.AgencyFeeDate = entOldPreLoan.AgencyFeeDate;
                entPreLoan.OutVouchFeeDate = entOldPreLoan.OutVouchFeeDate;
                entPreLoan.EndDate = entOldPreLoan.EndDate;
                entPreLoan.EstimReportBackDate = entOldPreLoan.EstimReportBackDate;
                entPreLoan.CompleteLoanDate = entOldPreLoan.CompleteLoanDate;
                entPreLoan.TJDate = entOldPreLoan.TJDate;
                entPreLoan.IsNoEvaluateFee = entOldPreLoan.IsNoEvaluateFee;
                entPreLoan.IdBankReceipt = entOldPreLoan.IdBankReceipt;
                entPreLoan.IdZhuanBen = entOldPreLoan.IdZhuanBen;
                entPreLoan.IsNoAgencyFee = entOldPreLoan.IsNoAgencyFee;
                entPreLoan.IdShouBen = entOldPreLoan.IdShouBen;
                entPreLoan.IsLack = entOldPreLoan.IsLack;
                entPreLoan.Mortgage = entOldPreLoan.Mortgage;
                entPreLoan.Mortgage = entOldPreLoan.Mortgage;
                entPreLoan.Total_Floor = entOldPreLoan.Total_Floor;
                entPreLoan.Total_Floor = entOldPreLoan.Total_Floor;
                entPreLoan.Status = 10;
                entPreLoan.TJPercent = entOldPreLoan.TJPercent;
                break;
        }
        return entPreLoan;
    } 
}